package com.rectcircle.scalatrateset.controller

import com.rectcircle.scalatrateset.model.User

/**
  * @author Rectcircle
  *         createTime 2017/1/1
  */
class ViewController extends ScalatratestStack{
	get("/inline"){
		contentType="text/html"
		
		<html>
			<head><title>Test</title></head>
			<body>contentType is {contentType}中文测试</body>
		</html>
	}
	
	get("/jade"){
		contentType="text/html"
		jade("hello-scalate")
	}
	
	get("/jade2"){
		contentType="text/html"
		layoutTemplate("/WEB-INF/templates/views/hello-scalate.jade")
	}
	
	get("/ssp"){
		contentType="text/html"
		ssp("ssptest","layout"->"","foo" -> "uno", "bar" -> "dos","user"->new User(0,"abc","111"))
	}
	
	get("/notfound"){
		contentType="text/html"
		ssp("notfound","layout"->"","path"->requestPath)
	}
}
